package com.mr.dao.entity.product;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;

import com.mr.constants.Tables;
import com.mr.dao.entity.BaseEntity;

/**
 * @author Alex
 */
@Entity(name = Tables.CATEGORY)
public class Category extends BaseEntity {
	private static final long serialVersionUID = 7158905997254521440L;
	private String name;
	private String img;
	@OneToMany(mappedBy = "category", cascade = CascadeType.ALL)
	private List<Product> products = new ArrayList<Product>(0);

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getImg() {
		return img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	public List<Product> getProducts() {
		return products;
	}

	public void setProducts(List<Product> products) {
		this.products = products;
	}

}
